package LuoGu.集合求和;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main_List {
    public static void main(String [] args) {
        List<Integer> list = new ArrayList<>();
        Scanner s = new Scanner(System.in);
        String temp = s.nextLine();
        Scanner in = new Scanner(temp);
        while(in.hasNextInt()) {
            list.add(in.nextInt());
        }
        int all = 0;
        for(int i=0;i<(1<<list.size());i++) {
            for(int j=0;j<list.size();j++) {
                if(((i>>j)&1)==1) all+=list.get(j);
            }
        }
        System.out.print(all);
    }
}

